/**
 * Created by lcfevr on 2018/5/4.
 */
$(function () {
    $('.btn_edit').click(function () {
        var emailReg = /^[a-zA-Z0-9_\-.]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;

        console.log(emailReg.test($('.js__email').val()));

        if ($('.js__first').val() == '') {
            $('.first_name .item_wrong').addClass('active')
        } else {
            $('.first_name .item_wrong').removeClass('active')
        }
        if ($('.js__last').val() == '') {
            $('.last_name .item_wrong').addClass('active')
        } else {
            $('.last_name .item_wrong').removeClass('active')
        }
        if ($('.js__email').val() == '' || !emailReg.test($('.js__email').val())) {
            $('.email_address .item_wrong').addClass('active')
        } else {
            $('.email_address .item_wrong').removeClass('active')
        }
    })
})